projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5ec0003
)
malloc_simple: Add debug() information
author
Simon Glass
<
[email protected]
>
Tue, 8 Sep 2015 23:52:46 +0000
(17:52 -0600)
committer
Simon Glass
<
[email protected]
>
Wed, 21 Oct 2015 13:46:25 +0000
(07:46 -0600)
It's useful to get a a trace of memory allocations in early init. Add a
debug() call to provide that. It can be enabled by adding '#define DEBUG'
to the top of the file.
Signed-off-by: Simon Glass <
[email protected]
>
Reviewed-by: Bin Meng <
[email protected]
>
common/malloc_simple.c
patch
|
blob
|
history
diff --git
a/common/malloc_simple.c
b/common/malloc_simple.c
index c74586376d3c61ce7c30aa927e888829ac76c174..dd1119f8cfbbde83b404c1a13a8577ca79f35000 100644
(file)
--- a/
common/malloc_simple.c
+++ b/
common/malloc_simple.c
@@
-19,10
+19,13
@@
void *malloc_simple(size_t bytes)
void *ptr;
new_ptr = gd->malloc_ptr + bytes;
+ debug("%s: size=%zx, ptr=%lx, limit=%lx\n", __func__, bytes, new_ptr,
+ gd->malloc_limit);
if (new_ptr > gd->malloc_limit)
return NULL;
ptr = map_sysmem(gd->malloc_base + gd->malloc_ptr, bytes);
gd->malloc_ptr = ALIGN(new_ptr, sizeof(new_ptr));
+
return ptr;
}
@@
-37,6
+40,7
@@
void *memalign_simple(size_t align, size_t bytes)
return NULL;
ptr = map_sysmem(addr, bytes);
gd->malloc_ptr = ALIGN(new_ptr, sizeof(new_ptr));
+
return ptr;
}